﻿// 在 http://fsharp.net 上了解有关 F# 的更多信息
// 请参阅“F# 教程”项目以获取更多帮助。
open System;
open Microsoft.Scripting.Hosting;
open IronPython.Hosting;
open IronPython.Runtime;
open System.Diagnostics;

[<EntryPoint>]
let main argv = 
    
    let stopwatch =new Stopwatch()
    stopwatch.Start()
    
    //

    let sr = Python.CreateRuntime()
    let scope = sr.UseFile("PClass.py")
    let d = scope.GetVariable<PythonFunction>("say")
    
    if(scope.Engine.Operations.IsCallable(d)) 
    then Console.WriteLine(scope.Engine.Operations.Invoke(d,"hello Python"))

    //

    stopwatch.Stop()
    printfn "%A" stopwatch.ElapsedMilliseconds
    ignore(Console.ReadKey());
    printfn "%A" argv
    0 // 返回整数退出代码